package com.ahs.controller.user;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.ahs.feign.accident.UserRestFeign;
import com.ahs.model.User;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;


/**
 * ClassName: UserController<br>

 * @author zp
 * @date: 2017年4月19日 下午12:51:30
 * @version V1.0
 * @since JDK 1.8
 */


@RestController
@RequestMapping(value="/region" , produces = MediaType.APPLICATION_JSON_VALUE)
@Api(description = "人员管理")
@RefreshScope
@ApiResponses({ @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 401, message = "我也不知道为啥"), @ApiResponse(code = 403, message = "禁止访问"), @ApiResponse(code = 404, message = "请求地址错误") })
public class UserController {

	@Autowired
	private UserRestFeign userRestFeign;

	/**
	 * 查找所有人员
	 * 
	 */
	@ApiOperation(value = "所有人员列表", httpMethod = "GET", notes = "所有人员列表")
	@RequestMapping(value = "/findByAll", method = RequestMethod.GET, produces = "application/json")
	public List<User> findByAll(){
			return userRestFeign.findByAll();
	}
	

}
